package com.wei.health.model.entity;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
public abstract class BaseUpdateEntity extends BaseEntity {

	private static final long serialVersionUID = 1620758104430484420L;

	private int creator;// 创建人id
	private String nickName;// 创建人姓名
	private Date createTime;// 创建时间
	private int updater;// 更新者id
	private Date updateTime;// 更新时间

	public void init(int userId,String userName) {
		this.creator = userId;
		this.nickName = userName;
		this.createTime = new Date();
		this.update(userId);
	}

	public void update(int userId) {
		this.updater = userId;
		this.updateTime = new Date();
	}

}